<template>
	<view>
		<!-- <u-navbar title="设置" :autoBack="true"></u-navbar> -->
		<u-cell-group >
			<u-cell title="个人资料" :isLink="true" icon="/static/icon/个人资料.png" size="large"
				url="/pages/user/userinfo"></u-cell>
			<u-cell title="收货地址" :isLink="true" icon="/static/icon/收货地址.png" size="large"
				url="/pages/public/address"></u-cell>
			<!-- <u-cell title="实名认证" :isLink="true" icon="/static/icon/实名认证.png" size="large"></u-cell> -->
			<u-cell title="清理缓存" icon="/static/icon/清理缓存.png" size="large" @click="clearcatche"></u-cell>
			<u-cell icon="/static/icon/检查更新.png" size="large" @click="checkupdate">
				<view slot="title" class="u-slot-title">
					<text style="font-size: 33upx;">检查更新</text>
					<text style="margin-left: 100upx;color: gray;">当前版本:1.0</text>
					</u-tag>
				</view>
			</u-cell>
		</u-cell-group>
		<!-- #ifndef MP -->
		<u-button type="primary" text="退出登录" :custom-style="{ 'width': '500rpx','margin-top':'60rpx' }" shape="circle" @click="toLogout"></u-button>
		<!-- #endif -->
	</view>
</template>

<script>
	import {
		mapMutations
	} from 'vuex';
	export default {
		data() {
			return {

			};
		},
		methods: {
			...mapMutations(['logout']),
			//退出登录
			toLogout() {
				uni.showModal({
					content: '确定要退出登录么',
					success: (e) => {
						if (e.confirm) {
							this.logout();
							setTimeout(() => {
								uni.navigateBack();
							}, 200)
						}
					}
				});
			},
			//清理缓存
			clearcatche() {
				uni.showModal({
					content: '确定要清理吗?',
					success: (e) => {
						if (e.confirm) {
							this.$api.msg(`清理成功！`);
						}
					}
				});
			},
			//检查更新
			checkupdate() {
				this.$api.msg(`当前已经是最新版本!`);
			}
		}
	}
</script>

<style>
</style>